package com.yuch.service.serviceImpl;

import com.yuch.service.PhoneCodeService;
import com.yuch.utils.CodeUtil;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class PhoneCodeServiceImpl implements PhoneCodeService {
    @Override
    @CachePut(value = "phoneCode",key = "#tel")
    public String senSMS(String tel,int n) {
        String code = CodeUtil.createCode(n);
        return code;
    }

    @Override
    @Cacheable(value = "phoneCode",key = "#tel")
    public String verifyCode(String  tel) {
        return null;
    }
}
